package cxy.highConcurrency;

public class Single {
	private volatile static Single s = null;

	private Single(){}

	public static Single getInstance() {
		if(s==null) {//提高效率,避免其他线程等待
			synchronized(Single.class){	
				if(s==null) {
		//				-->0 -->1
					s = new Single();
				}
			}
		}
		return s;
	}
}
